﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    @{
        string theme = "dark";
    }

    @*@if (Request.IsAuthenticated)
    {
        GDoc.Web.GDocPrincipal principal = User as GDoc.Web.GDocPrincipal;
        if (principal != null && principal.GIdentity.User.Theme == "light")
        {
            theme = "light";
        }
    }*@
    
    <link href="@Url.Content("~/Content/Site." + theme + ".css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/custom-theme/jquery-ui.css")" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/gdoc.common.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>    

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>

    @if (IsSectionDefined("Head"))
    {
        @RenderSection("Head", false);
    }
    <script type="text/javascript">
        function showDeleteDialog(title, message, callback) {
            $("#dialog:ui-dialog").dialog("destroy");

            $("#generic-dialog-form")[0].title = title;
            $("#generic-dialog-form").find("p#message").html(message);

            $("#generic-dialog-form").dialog({
                autoOpen: true,
                height: "auto",
                width: "auto",
                modal: true,
                resizable: false,
                buttons: {
                    Eliminar: function() {  
                            callback();

                            $(this).dialog("destroy");
                    },
                    Cancelar: function () {
                        $(this).dialog("destroy");
                    }
                },
                close: function () {
                    $(this).dialog("destroy");
                }
            });
        }

        function showErrorDialog(title, message) {
            $("#dialog:ui-dialog").dialog("destroy");

            $("#generic-dialog-form")[0].title = title;
            $("#generic-dialog-form").find("p#message").html(message);

            $("#generic-dialog-form").dialog({
                autoOpen: true,
                height: "auto",
                width: "auto",
                modal: true,
                resizable: false,
                buttons: {
                    "Aceptar": function () {
                        $(this).dialog("destroy");
                    }
                },
                close: function () {
                    $(this).dialog("destroy");
                }
            });
        }
    </script>
</head>

<body>
    <div class="page">

        <div id="header">
            <table border="0" cellpadding="0" cellspacing="0" style="width:100%; max-height: 58px;">
                <tr>
                    <td>
                        <div id="title">
                            <h1><a href="@Url.Action("Index", "Home")"><img src="@Url.Content("~/Content/gd-logo.png")" style="vertical-align:baseline;" />oc <span>document management made easy</span></a></h1>
                        </div>
                    </td>
                    <td>
                        <div id="logindisplay">
                            @Html.Partial("_LogOnPartial")
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="main">
            @RenderBody()
            <div id="footer">
            </div>
        </div>

        <footer>
            GDoc &copy; 2012 - <a href="#">Legal</a> - <a href="#">Acerca de</a> - <a href="#">Ayuda</a>
        </footer>
    </div>
    
    <div id="generic-dialog-form" title="" style="display: none">
        <p id="message"></p>
    </div>
</body>
</html>
